#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Datetime: 2021/10/30 15:09
# @Author  : CHEN Wang
# @Site    :
# @File    : trading_data_weeks.py
# @Software: PyCharm

"""
脚本说明: 计算与价量相关衍生指标, 每三天计算一次
"""

import os
import numpy as np
import pandas as pd
from datetime import datetime, timedelta
from quant_researcher.quant.project_tool.time_tool import get_yesterday, date_shifter, get_the_end_of_this_month, calc_date_diff
from quant_researcher.quant.datasource_fetch.crypto_api.glassnode import get_prices
from quant_researcher.quant.project_tool.localize import DATA_DIR
from TQR_Applications.factor_database.crypto.trading_data_update import get_all_ohlcvm_data
from quant_researcher.quant.datasource_fetch.crypto_api.coinmarketcap import get_all_coinlist_via_http
from quant_researcher.quant.project_tool.file_tool import get_all_filename_path
from quant_researcher.quant.datasource_fetch.crypto_api.self_defined import all_stalecoin_crypto
from quant_researcher.quant.performance_attribution.core_functions.performance_analysis.performance import prices_cleaning
from quant_researcher.quant.project_tool import hammer
from quant_researcher.quant.factors.factor_preprocess.preprocess import ts_threshold_signal
from sklearn.decomposition import PCA

from TQR_Applications.factor_database.crypto.trading_data_weeks import get_trading_data, all_ret_analysis

if __name__ == '__main__':
    # 统计涨跌幅数据
    get_trading_data(asset='BTC', start_date='2015-01-01', end_date=None)

    # 全市场收益率分析
    all_ret_analysis()